<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>直接通过别名发送GET请求或POST请求</title>
    <script src="../js/axios.min.js"></script>
</head>
<body>
<script>
    /*
        通过请求方式的别名，发送GET请求
     */
    axios.get("/JMS2301_03_javaWeb_war/axiosDemoServlet01?name=zhangsan&age=20&gender=man").then(function (resp) {
        alert(resp.data+"，发送的是GET请求")
        console.log(resp.data)
    })
    //post(请求的url,请求体参数)
    axios.post("/JMS2301_03_javaWeb_war/axiosDemoServlet01","name=zhangsan&age=20&gender=man").then(function (resp) {
        alert(resp.data+"，发送的是POST请求")
        console.log(resp.data)
    })

</script>
</body>
</html>